!!! 5
%html
  %head
    %meta{:charset => 'utf-8'}
    %meta{:name => 'viewport', :content => 'width=device-width, initial-scale=1.0'}
    %title ContestZone
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
    /[if lt IE 9]
      %script{:src => 'http://cdn.bootcss.com/ink/3.0.4/js/html5shiv.js'}
      %script{:src => 'http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js'}
  %body
    %nav.navbar.navbar-default.navbar-static-top{:role => 'navigation'}
      %div{:class => admin? ? 'container-fluid' : 'container'}
        .navbar-header
          %button{:type => 'button', :class => 'navbar-toggle', :'data-toggle' => 'collapse', :'data-target' => '.navbar-collapse'}
            %span.icon-bar
            %span.icon-bar
            %span.icon-bar
          = link_to 'ContestZone', root_path, class: 'navbar-brand'
        .collapse.navbar-collapse
          %ul.nav.navbar-nav.navbar-right
            %li= link_to 'Contest', '#'
            %li= link_to 'Activity', '#'
            %li= link_to 'About', '#'
            - if current_user.nil?
              %li= link_to 'Sign In', new_session_path(:user)
              %li= link_to 'Sign Up', new_registration_path(:user)
            - else
              %li.dropdown
                %a.dropdown-toggle{:href => '#', :'data-toggle' => 'dropdown'}
                  = current_user.name
                  %span.caret
                %ul.dropdown-menu{:role => 'menu'}
                  %li= link_to 'Setting', edit_registration_path(:user)
                  %li= link_to 'Sign Out', destroy_session_path(:user), method: :delete
    %div{:class => admin? ? 'container-fluid' : 'container'}
      - if notice
        .alert.alert-success.alert-dismissable.fade.in
          %button{:type => 'button', :class => 'close', :'data-dismiss' => 'alert', :'aria-hidden' => 'true'} &times;
          %p= notice
      - if alert
        .alert.alert-danger.alert-dismissable.fade.in
          %button{:type => 'button', :class => 'close', :'data-dismiss' => 'alert', :'aria-hidden' => 'true'} &times;
          %p= alert
    = yield